<?php 

use \Workerman\Worker;
use \GatewayWorker\BusinessWorker;
use \think\Db;

//配置数据库
$config = include(__DIR__ .'/db_config.php');
Db::setConfig($config);

// bussinessWorker 进程
$worker = new BusinessWorker();
// worker名称
$worker->name = 'YourAppBusinessWorker';
// bussinessWorker进程数量
$worker->count = 1;
// 服务注册地址
$worker->registerAddress = '127.0.0.1:1238';
$worker->eventHandler = '\app\Events';

// 如果不是在根目录启动，则运行runAll方法
if(!defined('GLOBAL_START'))
{
    Worker::runAll();
}